﻿var swfu;
var b = true;

window.onload = function () {
    var settings = {
        flash_url: "/Resource/swfupload.swf", // Relative to this file
        upload_url: "/Services/Uploads.ashx?AlbumId=" + AlbumId,
        file_size_limit: "3 MB",
        file_types: "*.jpg;*.gif;*.png;*.jpeg",
        file_types_description: "All Images",
        file_upload_limit: 100,
        file_queue_limit: 10,
        custom_settings: {
            progressTarget: "fsUploadProgress",
            cancelButtonId: "btnCancel"
        },
        debug: false,

        // Button settings
        button_image_url: "/images/button-flash.gif",
        button_width: "160",
        button_height: "22",
        button_placeholder_id: "spanButtonPlaceHolder",
        button_text: '<span class="button">Chọn tập tin <span class="buttonSmall">(3 MB 1 file)</span></span>',
        button_text_style: '.button { font-family: Arial;font-size: 12px; } .buttonSmall { font-size: 10pt; }',
        button_text_left_padding: 9,
        button_text_top_padding: 2,

        // The event handler functions are defined in handlers.js
        file_queued_handler: fileQueued,
        file_queue_error_handler: fileQueueError,
        upload_start_handler: uploadStart,
        upload_progress_handler: uploadProgress,
        upload_error_handler: uploadError,
        upload_complete_handler: uploadComplete,
        queue_complete_handler: queueComplete,
        upload_success_handler: uploadSuccess
    };

    swfu = new SWFUpload(settings);
};